package member.api;

import member.api.vo.MemberVo;
import member.model.core.CoreUser;
import member.model.shop.Member;

/**
 * Created by xiaoqian on 2016/10/9.
 */
public interface LoginApi {

    public String toString();

    /**
     * 用户名登录接口
     * @param userName
     * @param password
     * @return
     */
    public MemberVo checkByUsername(String  userName,String password);

    /**
     * 邮件登录接口
     * @param email
     * @param password
     * @return
     */
    public MemberVo checkByEmail(String  email,String password);

    /**
     * 电话号登录接口
     * @param phone
     * @param password
     * @return
     */
    public MemberVo checkByPhone(String  phone,String password);

    /**
     * openid登录接口
     * @param socialType
     * @param openid
     * @return
     * @See member.model.core.CoreUserSocial
     */
    public MemberVo checkByOpenId(String socialType,String openid);

    MemberVo loginBySms(String phone, String smsCheckCode);


    //会员中心登录
    //public CoreUser findByPhone(String  phone);
   // public CoreUser findByEmail(String  email);
    public CoreUser findById(String  id);
    public Member findByCoreUser(CoreUser coreUser);
    public CoreUser updateCoreUser(CoreUser coreUser);
    public Member updateMember(Member member);
    //密码加密
    public String encryptPasswd(String orginPasswd);
    public MemberVo loadMemberVo(CoreUser coreUser);

    CoreUser findByPhoneAndOrganizationIdAndUserType(String account, String id, String userTypeMember, boolean b);

    CoreUser findByEmailAndOrganizationIdAndUserType(String account, String id, String userTypeMember, boolean b);
}
